To test effectiveness of melatonin administration to subjects with advanced and delayed sleep phase syndrome, as well as subjects with endogenous depression. Hypotheses: 1) Patients with phase-advanced circadian rhythms will experience corrective phase delay shift when administered in morning but not afternoon. 2) Patients with phase-delayed circadian rhythms will experience corrective phase advance shift when melatonin is administered in the afternoon but not when administered in the morning.